<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>个人中心</title>
	<link rel="stylesheet" type="text/css" href="/files/usercenterMobile/css/ui.css">
	<link href="favicon.ico" type="image/x-icon" rel="icon">
	<link href="iTunesArtwork_402x.png" sizes="114x114" rel="apple-touch-icon-precomposed">
	<link href="../files/usercenter/css/templatecss.css" rel="stylesheet" type="text/css" />
	<link href="../files/usercenter/bootstrap-3.3.5-dist/css/bootstrap.min.css" title="" rel="stylesheet" />
	<link href="../files/usercenter/css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../files/usercenterMobile/js/jquery-1.7.1.min.js"></script>
</head>
<body>
	<div class="aui-container">
		<div class="aui-page">
			<div class="aui-page-my">
				<div class="aui-my-info">
					<div class="aui-my-info-back"></div>
					<a href="javascript:;" class="">
						<img src="" class="aui-my-avatar">
					</a>
					<div class="aui-mt-location aui-l-red"></div>
				</div>
				<div class="aui-l-content">
					<div class="aui-menu-list aui-menu-list-clear">



    <div class="container-fluid">
				<div class="info-center">
					<div class="page-header">
                      <div class="pull-left">
						<h4>消息中心</h4>      
					</div>
                            </div>
					<div class="info-center-title">
					    <span id="show" class="padding-large-right manage-title pull-left">
                           	<a class="active" href="javascript:void(0)">全部消息</a>
                        </span>
						<span id="send" class="padding-large-right pull-left">
							<a href="javascript:void(0)" >发送消息</a>
						</span>
					</div>
					
                    <div class="clearfix"></div>
					
					<div id="di1" class="table-margin">
                      <table class="table table-bordered table-header">
                      <thead>
                         <tr>
                           <td class="w15">标题</td>
                           <td class="w70">内容</td>
                           <td class="w15">时间</td>
                         </tr>
                         </thead>
                         <tbody>

 						#foreach($message in $messages)
                          <tr>
                          <td>$message.title</td>
                          <td>$message.content</td>
                          <td>$!date.format('yyyy-MM-dd HH:mm:ss ',$message.time)</td>
                         </tr>
 						#end
                         </tbody>
                      </table>
                    </div>
                    
                    
                    <div id="di2" class="table-margin"  style="background-color: #F5FFFA;padding: 10px;display:none" >
                    	<label for="txtName">接受者ID：</label><input id="s1" style="display: block;padding: 4px;width: 300px;border:1px solid #c8cccf;border-radius:4px;">
                    	<label for="txtName">标题：</label><input id="s2" style="display: block;padding: 4px;width: 300px;border:1px solid #c8cccf;border-radius:4px;">
                    	<label for="txtName">内容：</label><input id="s3" style="display: block;padding: 4px;width: 300px;height:100px;border:1px solid #c8cccf;border-radius:4px;">
                    	<br><button  id="subt" style="display: block;width: 300px;box-shadow: 0 1px 4px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);">发送</button>
                    </div>
                    
                    <script>
						$(function(){
							
							 $('#show').click(function(){ 
							 	$('#di1').show() ;$('#di2').hide() ;
							 	$(".inner-bg").css("border-bottom","solid 2px #098cba");
							 	$("#show").html("<a class='active' >全部消息</a>");
							 	$("#send").html("<a href='javascript:void(0)' >发送消息</a>");
							 });
							 
							$('#send').click(function(){ 
								$('#di2').show() ;$('#di1').hide() ;
								$("#show").html("<a href='javascript:void(0)' >全部消息</a>");
								$("#send").html("<a class='active' >发送消息</a>");
								}); 
							
						 $('#subt').click(function(){
											 
						var newpost=new Object();
						newpost.mfrom=$user.id;
						newpost.mto=$('#s1').val();
						newpost.title=$('#s2').val();
						newpost.content=$('#s3').val();
							$.ajax({
								 type: 'POST',
								 url: '/message/sendMessage',
								 data: newpost,
								 dataType: "json",
								 success: function(data){
								 	alert("消息已发送");
								 },
								 error: function(){
								 	alert("发送失败,暂不支持中文,请使用英文");
								 }
							});
						});
				});
				</script>
                    
				</div>
				<div class="show-page hidden">
					<ul>
					</ul>
				</div>
				
 
								
		</div>




						
						
						
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>